import java.util.Random;

/**
 * Creat with IntelliJ IDEA
 * Description:题库
 * User:FQH
 * Date:2021-12-13
 * Time:22:36
 */
public class QuestionBank {

    Random r =new Random();//随机数生成器
    boolean flg;//记录是否出完题目 - 默认为false
    int scq = 0;//single choice question - 记录已出单选题数量
    int mcq = 0;//multiple choice question - 记录已出多选题数量
    int jq = 0;//judgement question - 记录已出判断题数量

    public QuestionBank(){
        while(!flg){
            int type = r.nextInt()%3;
            if(type==0 && scq!=5){//出单选题
                scq++;

            }else if (type==1){//出多选题
                mcq++;

            }else {//出判断题
                jq++;

            }
            if(scq==5 && mcq==5 && jq==5){
                flg = true;
            }
        }

    }
}
